package com.itheima.controller.backend.Controller;

import com.itheima.DTO.OrderDTO;
import com.itheima.VO.OrderVO;
import com.itheima.common.entity.PageResult;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.common.entity.Result;
import com.itheima.controller.backend.Service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@Slf4j
@Api(tags ="预约列表相关接口")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/findPage")
    @ApiOperation("分页查询")
    public PageResult findPage(@RequestBody QueryPageBean queryPageBean){
        return orderService.findPage(queryPageBean);
    }

    @PostMapping("/update")
    @ApiOperation("修改状态")
    public Result update(@RequestBody OrderDTO orderDTO){
        orderService.update(orderDTO);
        return new Result(true,"修改预约状态成功",null);
    }


}
